<?php
/**
 * A simple description for this script
 *
 * PHP Version 5.2.0 or Upper version
 *
 * @package    Paylog
 * @author     Hidehito NOZAWA aka Suin <http://suin.asia>
 * @copyright  2010 Hidehito NOZAWA
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2
 *
 */

class Paylog_Kernel_CmsAdapter
{
	public static function &getInstance()
	{
		static $cms = null;

		if ( is_object($cms) )
		{
			return $cms;
		}

		if ( defined('XOOPS_ORETEKI') )
		{
			$cms = new Paylog_Kernel_Oreteki;
		}
		elseif ( defined('XOOPS_CUBE_LEGACY') )
		{
			$cms = new Paylog_Kernel_Xcl;
		}
		elseif ( defined('ICMS_VERSION_NAME') )
		{
			$cms = new Paylog_Kernel_Icms;
		}
		elseif ( strstr(XOOPS_VERSION, 'JPEx') )
		{
			$cms = new Paylog_Kernel_Jpex;
		}
		elseif ( strstr(XOOPS_VERSION, 'JP') )
		{
			$cms = new Paylog_Kernel_Xoops20;
		}
		elseif ( strstr(XOOPS_VERSION, 'XOOPS 2.[2-4]') )
		{
			$cms = new Paylog_Kernel_Xoops22;
		}
		else
		{
			$cms = new Paylog_Kernel_Xoops20;
		}

		return $cms;
	}
}

?>
